#ifndef __DAEMON_SUB_PROCESS_MONITOR_H_
#define __DAEMON_SUB_PROCESS_MONITOR_H_

#define PROCESS_CMD "/usr/bin/gateway"
//#define PROCESS_CMD "/home/atguigu/gateway_0423/gateway"
#define FAILED_MAX_COUNT 3

typedef struct {
    char *sub_process_arg; // app|ota...
    int sub_process_pid;
    int failed_count;
}sub_process_monitor_t ;


/**
 * @brief 子进程监控器的初始化
 */
sub_process_monitor_t* daemon_sub_process_monitor_init(char *sub_process_arg); 


/**
 * @brief 子进程监控器 检查和启动
 */
int daemon_sub_process_monitor_checkAndStart(sub_process_monitor_t *monitor);


/**
 * @brief 子进程监控器的销毁
 */
void daemon_sub_process_monitor_destroy(sub_process_monitor_t *monitor);


#endif // __DAEMON_SUB_PROCESS_MONITOR_H_
